public class Day01 {
    public static void main(String[] args) {
        char s = '\u0639';
//        float f = 45.6;
    }

    // 判断是否回文
    public boolean judge (String str) {
        int l = 0;
        int r = str.length() - 1;
        while(l < r) {
            if(str.charAt(l++) != str.charAt(r--)) {
                return false;
            }
        }
        return true;
    }

    // 计算并返回平方根（向下取整）
    public int sqrt(int x) {
        int l = 1;
        int r = x;
        while(l <= r) {
            int mid = l + (r - l) / 2;
            if(mid > x / mid) {
                r = mid - 1;
            } else if(mid + 1 > x / (mid + 1) && mid <= x / mid) {
                return mid;
            } else{
                l = mid + 1;
            }
        }
        return x;
    }
}
